package com.chixing.controller;


import com.chixing.entity.Car;
import com.chixing.entity.vo.CarAddress;
import com.chixing.entity.CarOutlets;
import com.chixing.service.impl.CarOutletsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shy
 * @since 2022-10-20
 */
@Controller
@RequestMapping("/carOutlets")
public class CarOutletsController {
    @Autowired
    private CarOutletsServiceImpl carOutletsService;
    @GetMapping("/carAllList")
    public ModelAndView searchAllCar(){
        List<Car> carList = carOutletsService.getAllCar();

        System.out.println("车辆列表:"+carList);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("carList",carList) ;
        modelAndView.setViewName("Offline_outlets/Car-search");
        return modelAndView;
    }

}
